package com.com.corejavalearnings.reflection;

/**
 * Created by User on 30/07/2014.
 */
public class ClassExample {
    public static void main(String... a) throws Exception{
       int [] i= new int[10];
       double [] d = new double[8] ;

        System.out.println(i.getClass().getName());
        System.out.println(i.getClass().getCanonicalName());
        System.out.println(i.getClass().getSimpleName());

        System.out.println(d.getClass().getCanonicalName());
        System.out.println(d.getClass().getSuperclass());
        //System.out.println(d.getClass().getClassLoader().getClass().getSimpleName());

        System.out.println(void.class.getSimpleName());
        System.out.println(void.class.getCanonicalName());
        System.out.println(void.class.getName());

        Number n = new Long(0L);
        Class<?>            c1 = Integer.class;
        Class<?>                 c2 = Class.forName("java.lang.Number");
        Class<? extends Number>  c3 = n.getClass();

        Number number = (Integer)c1.newInstance();
        System.out.print(number.toString());
    }
}
